package com.ktgj.flight.service;

import com.ktgj.customer.api.domain.BankCard;
import com.ktgj.customer.api.domain.Customer;
import com.ktgj.flight.common.linkstar.domain.CalculateRefundRes;
import com.ktgj.flight.common.linkstar.domain.airReIssuePrice.AirReIssuePriceRequest;
import com.ktgj.flight.common.linkstar.domain.airReIssuePrice.ReIssuePriceResponse;
import com.ktgj.flight.common.linkstar.domain.changeFlight.ChangeFlightRequest;
import com.ktgj.flight.common.linkstar.domain.fightdetails.FlightInfoReqVo;
import com.ktgj.flight.common.linkstar.domain.fightdetails.FlightInfoVo;
import com.ktgj.flight.common.linkstar.domain.publishprice.FlightPublishPriceReqVo;
import com.ktgj.flight.common.linkstar.domain.publishprice.FlightPublishPriceResVo;
import com.ktgj.flight.common.linkstar.domain.searchFlight.one.FlightTransfer;
import com.ktgj.flight.common.linkstar.domain.stopfight.FightStopReqVo;
import com.ktgj.flight.common.linkstar.domain.stopfight.FightStopResVo;
import com.ktgj.flight.domain.ChangeCreateOrder;
import com.ktgj.flight.domain.Flight;
import com.ktgj.flight.domain.FlightOrderChange;
import com.ktgj.flight.domain.FlightResponseDTO;
import com.ktgj.flight.domain.InterfaceEntity.*;
import com.ktgj.flight.domain.vo.*;
import com.ktgj.flight.vo.FlightResponseVo;
import com.ktgj.flight.vo.FlightVo;
import com.ktgj.pay.api.domain.BankCardApi;
import com.ktgj.pay.api.domain.CustomerApi;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 航线信息维护Service接口
 * 
 * @author ruoyi
 * @date 2021-08-30
 */
public interface IFlightService 
{
    /**
     * 查询航线信息维护
     * 
     * @param flightId 航线信息维护ID
     * @return 航线信息维护
     */
    public Flight selectFlightById(Long flightId);

    /**
     * 查询航线信息维护列表
     * 
     * @param flight 航线信息维护
     * @return 航线信息维护集合
     */
    public List<Flight> selectFlightList(Flight flight);

    /**
     * 新增航线信息维护
     * 
     * @param flight 航线信息维护
     * @return 结果
     */
    public int insertFlight(Flight flight);

    /**
     * 修改航线信息维护
     * 
     * @param flight 航线信息维护
     * @return 结果
     */
    public int updateFlight(Flight flight);

    /**
     * 批量删除航线信息维护
     * 
     * @param flightIds 需要删除的航线信息维护ID
     * @return 结果
     */
    public int deleteFlightByIds(Long[] flightIds);

    /**
     * 删除航线信息维护信息
     * 
     * @param flightId 航线信息维护ID
     * @return 结果
     */
    public int deleteFlightById(Long flightId);

    /**
     * 航班查询
     * @param searchRequest
     * @return
     * @throws Exception
     */
    List<FlightResponseVo> getFlightInfoListBySearchCondition(Customer customer, MoFlightSearchRequest searchRequest) throws Exception;

    /**
     * app往返查询
     * @param customer
     * @param searchRequest
     * @return
     */
    List<FlightVo> getFlightInfoList(Customer customer, MoFlightSearchRequest searchRequest) throws Exception;

    /**
     * app往返查询返程
     * @param customer
     * @param searchRequest
     * @return
     */
    List<FlightVo> getFlightInfoListBack(Customer customer, MoFlightSearchRequest searchRequest) throws Exception;

    /**
     * 航班详情（单程）
     * @param searchRequest
     * @return
     */
    FlightVo flightDetails(Customer customer, MoFlightSearchRequest searchRequest);

    /**
     * 航班详情（中转）
     * @param transferId
     * @return
     */
    FlightTransfer flightTransfers(Customer customer, String transferId, String depDate, String dstAirport, String orgAirport);

    /**
     * 航班详情（往返）
     * @param searchRequest
     * @return
     */
    FlightResponseDTO flightReturn(Customer customer, MoFlightSearchRequest searchRequest);

    /**
     * 创建机票订单
     * @param moRequest
     */
    FlightOrderResponse createOrder(MoCreateOrderRequest moRequest, String token);

    /**
     * 保存机票订单（CRM）
     * @param moRequest
     * @param customerId
     * @return
     */
    FlightOrderResponse createOrderCRM(MoCreateOrderRequest moRequest, Long customerId);

    /**
     * 生成预定命令（CRM）
     * @param moRequest
     * @return
     */
    FlightOrderResponse createPNR(MoCreateOrderRequest moRequest);

    /**
     * 取消预订指令取消PNR
     * @param pnr
     * @return
     */
    MoCancelOrderResponse cancelPNR(String pnr);

    /**
     * 查询订单信息
     */
    MoQueryOrderResponse searchOrderInfo(MoQueryOrderRequest orderRequest);

    /**
     * 取消订单
     * @param moRequest
     * @return
     */
    MoCancelOrderResponse cancelOrder(MoCancelOrderRequest moRequest);

    /**
     * 支付订单
     * @param moRequest
     * @return
     */
    MoOrderPayResponse payOrder(MoOrderPayRequest moRequest);


    /**
     * 根据航班号和日期查询航班信息
     * @param vo
     * @return
     */
    FightStopResVo searchStopFightInfo(FightStopReqVo vo);

    /**
     * 退票
     * @param moRequest
     * @return
     */
    MoOrderRefundResponse orderRefund(MoOrderRefundRequest moRequest, HttpServletRequest servletRequest) throws Exception;

    /**
     * CRM退票
     * @param orderChange
     * @return
     */
    MoOrderRefundResponse orderRefundCRM(FlightOrderChange orderChange) throws Exception;

    /**
     * 改签退票
     * @param moRequest
     * @return
     */
    MoOrderRefundResponse changeOrderRefund(MoOrderRefundRequest moRequest, HttpServletRequest request) throws Exception;

    /**
     * CRM改签退票
     * @param orderChange
     * @return
     */
    MoOrderRefundResponse changeOrderRefundCRM(FlightOrderChange orderChange);

    /**
     * 改签机票
     * @param changeRequest
     * @return
     */
    MoOrderChangeResponse ticketChangeFlight(MoOrderChangeRequest changeRequest);

    /**
     * 机票详细仓位以及价格
     * @param vo
     * @return
     */
    FlightPublishPriceResVo publishPrice(FlightPublishPriceReqVo vo);

    /**
     * 客票变更搜索(改签航班查询)
     * @param request
     * @return
     */
    public List<FlightVo> changeSearchFlight(ChangeFlightRequest request);

    /**
     * 客票变更搜索（改签航班详情）
     * @param request
     * @return
     */
    public FlightVo changeDetails(ChangeFlightRequest request);

    /**
     * 改签生成订单
     * @param order
     * @return
     */
    public FlightOrderResponse changeCreateOrder(ChangeCreateOrder order);

    /**
     * 取消改签
     * @param flightCancelChange
     * @return
     */
    public int cancelChange(FlightCancelChangeVO flightCancelChange);

    /**
     * 计算改签费用（领达使用）
     * @param request
     * @return
     */
    public ReIssuePriceResponse testAirReIssuePrice(AirReIssuePriceRequest request);

    /**
     * 领达退票前信息确认
     * @param ticketNo
     * @return
     */
    CalculateRefundRes orderRefundConfirm(List<String> ticketNo, boolean voluntary);

    /**
     * 机票查询常用旅客
     * */
    public FileCommonTravelersVo fileCommonTravelers(String token) throws Exception;

    /**
     * 机票查询常用旅客
     * */
    public List<FileCommonTravelers> bankCommonTravelers(Map<String, Object> map) throws Exception;

    /**
     * 机票银行卡支付
     * */
    public String bankCardPayment(FlightPayVo flightPayVo, HttpServletRequest request) throws Exception;

    /**
     * 改签机票银行卡支付
     * */
    public String changeBankCardPay(FlightPayVo flightPayVo, HttpServletRequest request) throws Exception;

    boolean clearFlightCache(String depDate, String dstAirport, String orgAirport, String backDepDate);
}
